home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / HENSA / MATHS / PLPLOT / PLPLOT.ZIP / doc / Xauthority < prev   
Encoding:
Text File  |  1994-04-08  |  25.7 KB  |  611 lines

  1. IMPORTANT NOTE about the plplot Tcl/TK driver :
  2.  
  3.     IF YOU DO NOT HAVE XAUTH STYLE SECURITY ENABLED, YOU ARE VULNERABLE TO
  4.     OUTSIDE INTRUSION.  I MAKE NO CLAIMS THAT PLPLOT/TK IS SAFE AGAINST
  5.     SUCH AN ATTACK, AND ASSUME NO RESPONSIBILITY FOR RISK.  
  6.  
  7. To reiterate the statement made elsewhere:
  8.  
  9.     There is no warranty or other guarantee of fitness of this software.
  10.     It is provided solely "as is". The author(s) disclaim(s) all
  11.     responsibility and liability with respect to this software's usage or
  12.     its effect upon hardware or computer systems.
  13.  
  14. OK, now for some clarification.  The Tcl7.0/TK3.3 release attempts to
  15. improve security by using the Xauthority mechanism (there are other ways
  16. but this was a quick fix).  To use it, you must either deal with the new
  17. access control method or compile Tcl/TK with security off.  It's not
  18. really a big deal using the new access method but can be anything from
  19. only mildly confusing initially to a major pain in the neck.
  20.  
  21. This file contains various comments, tricks, tips, explanations, or
  22. anything else I could dig up on Xauthority.  xauth-style security really
  23. does represent a big improvement over xhost-based access, since xhost
  24. leaves you open to intrusion from anyone on the machine you are granting
  25. access to.  With conventional X applications, the danger is not so great
  26. (IMO), for it would take a fairly sophisticated trojan horse to exploit
  27. the security leak (a fake xterm, for example).  But Tcl/TK changes the
  28. nature of this game completely.  The incredible power offered by Tcl/TK
  29. means much potential for evil as well as good.  I will tell you how badly
  30. you can be hacked, since the hackers presumably already know this.
  31.  
  32. Say you grant xhost access to a machine where someone wishes to do you
  33. harm.  This person starts up a "wish" (TK windowing shell) connected
  34. to your machine, but modified to not display an actual window so as
  35. to not raise your suspicions.  A "show interps" command (or something
  36. like that) displays the names of the Tcl interpreters that your Tcl/TK
  37. applications are using.  Then the hacker merely needs to send commands
  38. to these interpreters to do nasty things, the classic being "exec rm -rf
  39. *".  Yes, this is a legal Tcl command.  
  40.  
  41. Using xauth this is prevented.  You can also prevent it by renaming the
  42. dangerous commands in your interpreter to {} (null), thus preventing their
  43. use altogether.  In fact I do this in plserver.tcl, but prior to plplot
  44. 4.99e I had neglected to do it in the TK driver's interpreter as well,
  45. meaning I still wasn't safe.  This was an oversight on my part, but a very
  46. easy one to make, meaning you'd best exercise some caution.  If you do NOT
  47. have the Tcl/TK xauth security feature enabled (it is possible to compile
  48. Tcl/TK with it turned off), and also grant xhost access, you'd best know
  49. whether or not your TK apps are hack-resistant.  My renaming the "exec"
  50. and "open" commands (the latter can be done only after all autoloading
  51. takes place) takes care of the two most flagrant examples of security
  52. holes, but there may be others, so caveat emptor.
  53.  
  54. Before too long I will also support the Tcl-DP method (sockets) for 
  55. communication between the client and the renderer.  Fortunately, the
  56. issue of security was recently taken up in earnest by the Tcl-DP author
  57. as well, so I don't see any reasons not to pursue this right away (except
  58. lack of time).  This will allow better operation of the tk driver across
  59. slow networks, as well as actually running the renderer on a different
  60. machine as the client.
  61.  
  62. So here is my quickie explanation of how to get Xauthority working.
  63. I had no trouble on our HP X terminals, but lots on the console.  Your
  64. mileage may vary.  If you have extreme problems, yell at your vendor,
  65. but if you only grant xhost access to secure machines then you might
  66. also consider compiling Tcl/TK without the security feature.
  67.  
  68. ---------------------------------------------------------------------
  69.  
  70. First, you need to have a file ~/.Xauthority.  If you already have this,
  71. you are off to a good start.  In this case your X server is already set to
  72. use xauth style security.  If not, you need to create a ~/.Xauthority
  73. file.  You can do this by running "xauth" and then making entries.  You
  74. will need to reset the X server for this change to take effect.  If you
  75. are at the console this may mean a reboot (my HP running VUE gave me a bit
  76. of a hard time).
  77.  
  78. You next disable all xhost based access.  This means not only typing
  79. "xhost -", but deleting all hosts named as having access when you
  80. type "xhost".
  81.  
  82. Finally you ftp your ~/.Xauthority file to your home directory on the
  83. machine you are running client X applications.  When they start up, they
  84. will try to create windows on your local server as specified by DISPLAY
  85. (or whatever).  The client and server then exchange magic cookies, and
  86. when they match, the client gains access and is allowed to make X
  87. requests.
  88.  
  89. Note that you may in general need to ftp your ~/.Xauthority file to the
  90. desired hosts each session, because at least on my machine the X server
  91. writes a new magic cookie in ~/.Xauthority each time it is run.  This
  92. is basically analogous to reenabling xhost access each time you log in.
  93.  
  94. -----------------------------------------------------------------------
  95.  
  96. Below I've appended another person's explanation of what needs to be done,
  97. as posted on comp.lang.tcl.
  98.  
  99. -----------------------------------------------------------------------
  100.  
  101. Author: Vivek Khera <khera@cs.duke.edu>        -*- text -*-
  102. Subject: making your X server more secure
  103. Originally Written: Tue, 10 Jul 90 12:26:15 -0400
  104. Time-stamp: "August 10, 1993 12:28:31"
  105.  
  106. Here's how I have made my X sessions more secure than just the xhost
  107. way.  It is mostly transparent, and doesn't allow arbitrary users to
  108. plaster windows on my screen, or to snoop at my keyboard.  Even people
  109. who log into the machine I'm working on can't connect to the server.
  110.  
  111. This whole scheme is based on the MIT-MAGIC-COOKIE scheme, where each
  112. client must present to the server a magic cookie to prove that it is
  113. allowed to connect.  The cookie is kept in a file in your home
  114. directory (.Xauthority) which only you are allowed to read.  The
  115. server reads this file when it starts up, so if you change the cookie
  116. file, you will have to restart the server to make it read the new
  117. information.  Normally you don't need to do this.  The .Xauthority
  118. files can be merged using the xauth program.  See the man page for
  119. some more details.
  120.  
  121. Here is how to make yourself "secure":
  122.  
  123. 1. Create a .xserverrc file similar to mine in your home directory.
  124. The important part is to pass the "-auth $HOME/.Xauthority" option to
  125. the X server on the last line.  Here is what my .xserverrc file looks
  126. like:
  127.  
  128. --cut here--
  129. #!/bin/sh
  130. # for Xsun:
  131. # -ar1 NNN    set keyboard repeat delay to NNN milliseconds
  132. # -ar2 NNN    set keyboard repeat rate to NNN milliseconds
  133.  
  134. if test -w /dev/cgthree0 -o -w /dev/cgsix0; then
  135.   server=Xsun
  136. else
  137.   server=XsunMono
  138. fi
  139.  
  140. # we *must* do an exec for the server so that signals are handled properly
  141. exec $server -ar1 250 -ar2 20 -auth $HOME/.Xauthority
  142. --cut here--
  143.  
  144.  
  145. 2. Before you start the X server, be sure to create the .Xauthority
  146. file.  I wrote a shell script to do this, called newcookie.  You must
  147. create a new .Xauthority file when you switch machines, as the name of
  148. the machine the server is on is part of the authority mechanism.  This
  149. is how it knows which cookie to send to which server it is connecting
  150. to.  I run newcookie from my .login file when I am logging into the
  151. console.  If you run newcookie after you start the X server, you are
  152. hosed unless you can remember the random number it generated and
  153. recreate the .Xauthority file by hand; otherwise you will have to quit
  154. and restart the server.
  155.  
  156. Here is my newcookie program.  If you have a program that generates
  157. md5 signatures, you can use it to generate a strong random number by
  158. passing the -md5 flag.  If you have md4, just edit the script to use
  159. it instead of md5.  If you don't have md4 or md5, then it assumes you
  160. have perl to generate random numbers.  If you don't have perl, then
  161. write your own program to generate a long random number with an even
  162. number of hexadecimal digits in it, and then run "xauth add" like in
  163. my program.  Note that md4 and md5 generate values that an even number
  164. of digits long already.  An implementation of md5 can be found in
  165. Internet RFC 1321.
  166.  
  167. --cut here--
  168. #!/bin/sh
  169.  
  170. # create new .Xauthority file
  171.  
  172. PATH=/usr/local/X/bin:/usr/gnu/bin:$PATH
  173.  
  174. # try some security
  175. auth=$HOME/.Xauthority
  176. #cp /dev/null $auth
  177.  
  178. # generate a nice long random key
  179. if [ "$1" = "-md5" ]; then
  180.   # use a random noise source and get a strong checksum of it.
  181.   # this is probably a stronger random number than the other method.
  182.   key=`pstat -pfS | md5`
  183. else
  184.   # quick and dirty.  can probably be recreated if time can be guessed.
  185.   key=`perl -e 'srand; printf int(rand(100000000000000000))'`
  186.   # use $key$key to make sure even length.
  187.   key=$key$key
  188. fi
  189. # add to auth file. 
  190. xauth add ${HOST}/unix:0 . $key
  191. xauth add ${HOST}:0 . $key
  192. --cut here--
  193.  
  194. 3. Make sure any program you run does not do an xhost +<machine>
  195. command.  This will destroy any security you might gain by using
  196. xauth.  Notably, the rcmd script does this.
  197.  
  198. 4. Start the X server using startx.  Things should be secure now.  All
  199. new X clients (from R4 and later) understand this authorization
  200. scheme, so you should never need to run xhost again. (Unless you are
  201. using the standard Ultrix libraries -- but then you get what you
  202. deserve.)  In fact, xhost should report *no* hosts as being allowed
  203. in.
  204.  
  205. -----------------------------------------------------------------------
  206.  
  207. Here's the (not very helpful) information I got from the man pages:
  208.  
  209. -----------------------------------------------------------------------
  210.  
  211. From X(1):
  212.  
  213.  ACCESS CONTROL
  214.       An X server can use several types of access control.  Mechanisms
  215.       provided in Release 5 are:
  216.       Host Access            Simple host-based access control.
  217.       MIT-MAGIC-COOKIE-1        Shared plain-text "cookies".
  218.       XDM-AUTHORIZATION-1        Secure DES based private-keys.
  219.       SUN-DES-1            Based on Sun's secure rpc system.
  220.  
  221.       vuelogin/Xdm initializes access control for the server, and also
  222.       places authorization information in a file accessible to the user.
  223.       Normally, the list of hosts from which connections are always accepted
  224.       should be empty, so that only clients with are explicitly authorized
  225.       can connect to the display.  When you add entries to the host list
  226.       (with xhost), the server no longer performs any authorization on
  227.       connections from those machines.    Be careful with this.
  228.  
  229.       The file from which Xlib extracts authorization data can be specified
  230.       with the environment variable XAUTHORITY, and defaults to the file
  231.       .Xauthority in the home directory.  vuelogin/Xdm uses
  232.       $HOME/.Xauthority and will create it or merge in authorization records
  233.       if it already exists when a user logs in.
  234.  
  235.       If you use several machines, and share a common home directory across
  236.       all of the machines by means of a network file system, then you never
  237.       really have to worry about authorization files, the system should work
  238.       correctly by default.  Otherwise, as the authorization files are
  239.       machine-independent, you can simply copy the files to share them.  To
  240.       manage authorization files, use xauth.  This program allows you to
  241.       extract records and insert them into other files.  Using this, you can
  242.       send authorization to remote machines when you login, if the remote
  243.       machine does not share a common home directory with your local
  244.       machine.    Note that authorization information transmitted ``in the
  245.       clear'' through a network file system or using ftp or rcp can be
  246.       ``stolen'' by a network eavesdropper, and as such may enable
  247.       unauthorized access.  In many environments this level of security is
  248.       not a concern, but if it is, you need to know the exact semantics of
  249.       the particular authorization data to know if this is actually a
  250.       problem.
  251.  
  252.  
  253. From Xserver(1):
  254.  
  255.  SECURITY
  256.       The sample server implements a simplistic authorization protocol,
  257.       MIT-MAGIC-COOKIE-1 which uses data private to authorized clients and
  258.       the server.  This is a rather trivial scheme; if the client passes
  259.       authorization data which is the same as the server has, it is allowed
  260.       access.  This scheme is inferior to host-based access control
  261.       mechanisms in environments with unsecure networks as it allows any
  262.       host to connect, given that it has discovered the private key.  But in
  263.       many environments, this level of security is better than the host-
  264.       based scheme as it allows access control per-user instead of per-host.
  265.  
  266.       In addition, the server provides support for a DES-based authorization
  267.       scheme, XDM-AUTHORIZATION-1, which is more secure (given a secure key
  268.       distribution mechanism), but as DES is not generally distributable,
  269.       the implementation is missing routines to encrypt and decrypt the
  270.       authorization data.  This authorization scheme can be used in
  271.       conjunction with XDMCP's authentication scheme, XDM-AUTHENTICATION-1
  272.       or in isolation.
  273.  
  274.       The authorization data is passed to the server in a private file named
  275.       with the -auth command line option.  Each time the server is about to
  276.       accept the first connection after a reset (or when the server is
  277.       starting), it reads this file.  If this file contains any
  278.       authorization records, the local host is not automatically allowed
  279.       access to the server, and only clients which send one of the
  280.       authorization records contained in the file in the connection setup
  281.       information will be allowed access.  See the Xau manual page for a
  282.       description of the binary format of this file.  Maintenance of this
  283.       file, and distribution of its contents to remote sites for use there
  284.       is left as an exercise for the reader.
  285.  
  286.       The sample server also uses a host-based access control list for
  287.       deciding whether or not to accept connections from clients on a
  288.       particular machine.  This list initially consists of the host on which
  289.       the server is running as well as any machines listed in the file
  290.       /etc/Xn.hosts, where n is the display number of the server.  Each line
  291.       of the file should contain an Internet hostname (e.g.
  292.       expo.lcs.mit.edu.)  There should be no leading or trailing spaces on
  293.       any lines.  For example:
  294.  
  295.           joesworkstation
  296.           corporate.company.com
  297.  
  298.       Users can add or remove hosts from this list and enable or disable
  299.       access control using the xhost command from the same machine as the
  300.       server.  For example:
  301.  
  302.           %  xhost +janesworkstation
  303.           janesworkstation being added to access control list
  304.           %  xhost +
  305.           all hosts being allowed (access control disabled)
  306.           %  xhost -
  307.           all hosts being restricted (access control enabled)
  308.           %  xhost
  309.           access control enabled (only the following hosts are allowed)
  310.           joesworkstation
  311.           janesworkstation
  312.           corporate.company.com
  313.  
  314. -----------------------------------------------------------------------
  315.  
  316. Here's the responses from readers of comp.lang.tcl to my frenzied cry
  317. for help:
  318.  
  319. -----------------------------------------------------------------------
  320.  
  321. From ashoks@duckjibe.Eng.Sun.COM Mon Sep 13 15:53:33 1993
  322. From: ashoks@duckjibe.Eng.Sun.COM (Ashok Singhal)
  323. Newsgroups: comp.lang.tcl
  324. Subject: Re: New security "feature" in Tk 3.3
  325. Date: 11 Sep 1993 01:23:36 GMT
  326. Organization: Sun Microsystems, Inc.
  327. Distribution: world
  328. Reply-To: ashoks@duckjibe.Eng.Sun.COM
  329. NNTP-Posting-Host: duckjibe
  330.  
  331. I managed to get "send" tk3.3b2 to work with a non-local X server after some
  332. initial difficulties with xauth (now there's a poorly documented utility; took
  333. me several readings of the man page to figure out how to use it, what hex keys
  334. were, no cross references, ...)
  335.  
  336. My set up: application is running on a Sparcserver 1000  running Solaris 2.3,
  337. X server (i.e. display) is a SS10 running OpenWindows 3
  338.  
  339. I had xhost- based authorization set up initially, I disabled it and
  340. used xauth.  Didn't work.
  341.  
  342. I shut down and restarted the window system on the server
  343. and set up xauth again and it worked.
  344.  
  345. I have no idea why/how it did not work the first time and worked after
  346. I restarted the window system.
  347.  
  348. - Ashok Singhal
  349. Sun Microsystems
  350.  
  351.  
  352. From schwartz@roke.cse.psu.edu Mon Sep 13 15:53:35 1993
  353. Newsgroups: comp.lang.tcl
  354. From: schwartz@roke.cse.psu.edu (Scott Schwartz)
  355. Subject: Re: New security "feature" in Tk 3.3
  356. In-Reply-To: ashoks@duckjibe.Eng.Sun.COM's message of 11 Sep 1993 01:23:36 GMT
  357. Nntp-Posting-Host: roke.cse.psu.edu
  358. Date: Sat, 11 Sep 1993 02:12:10 GMT
  359.  
  360. ashoks@duckjibe.Eng.Sun.COM (Ashok Singhal) writes:
  361.    I have no idea why/how it did not work the first time and worked after
  362.    I restarted the window system.
  363.  
  364. The X server needs to be started with the ``-auth authfile'' flag.  If
  365. you create that file and then restart, the openwin script will notice it
  366. and invoke the X server with the right parameters.  (Under MIT X, See
  367. the Xserver and Xsecurity manpages.)
  368.  
  369.  
  370. From mjl@dino.ph.utexas.edu Tue Sep 14 11:51:35 1993
  371. From: mjl@dino.ph.utexas.edu (Maurice J. LeBrun)
  372. Newsgroups: comp.lang.tcl
  373. Subject: Re: New security "feature" in Tk 3.3
  374. Date: 14 Sep 93 11:35:21
  375. Organization: The University of Texas at Austin
  376. NNTP-Posting-Host: dino.ph.utexas.edu
  377. In-reply-to: schwartz@roke.cse.psu.edu's message of Sat, 11 Sep 1993 02:12:10 GMT
  378. Status: RO
  379.  
  380.  
  381. Thanks to all who replied.  I have xauth-style access control working
  382. perfectly on my HP 720 running HPUX 9.01 and VUE 3.0 now.
  383.  
  384. For most people, the steps:
  385.     - create the ~/.Xauthority file or make sure it exists
  386.     - ftp ~/.Xauthority to the remote host
  387.     - disable xhost access
  388.  
  389. worked fine, so (still having no luck on the system console) I tested it
  390. on a nearby X-terminal, and it worked just fine.
  391.  
  392. schwartz@roke.cse.psu.edu (Scott Schwartz) writes:
  393.  
  394.    ashoks@duckjibe.Eng.Sun.COM (Ashok Singhal) writes:
  395.       I have no idea why/how it did not work the first time and worked after
  396.       I restarted the window system.
  397.  
  398.    The X server needs to be started with the ``-auth authfile'' flag.  If
  399.    you create that file and then restart, the openwin script will notice it
  400.    and invoke the X server with the right parameters.  (Under MIT X, See
  401.    the Xserver and Xsecurity manpages.)
  402.  
  403. This was the key.  After poring through the documentation I found I needed
  404. to uncomment the line:
  405.  
  406. # Vuelogin*authorize:         True
  407.  
  408. in the file /usr/vue/config/Xconfig.  But it still wouldn't work, because
  409. the X server needed to be restarted.  I thought specifying
  410.  
  411. Vuelogin*terminateServer:       True
  412.  
  413. would do the job, but it didn't (the X server is normally started by init
  414. during bootup).  So I rebooted the machine.  After that, it worked fine.
  415.  
  416. Quite a lot to go through!  Since the release of Tk3.3 will have this
  417. security mechanism set by default, it would be a good idea to include a
  418. note about getting xauth-style access working on HP's running HPUX/VUE.
  419.  
  420. --
  421. Maurice LeBrun    mjl@dino.ph.utexas.edu
  422. Institute for Fusion Studies, University of Texas at Austin
  423.  
  424. Faire de la bonne cuisine demande un certain temps.  Si on vous fait
  425. attendre, c'est pour mieux vous servir, et vous plaire.
  426.                                 [menu of restaurant Antoine, New Orleans]
  427.  
  428. From mjl@dino.ph.utexas.edu Fri Sep 17 15:01:21 1993
  429. From: mjl@dino.ph.utexas.edu (Maurice J. LeBrun)
  430. Newsgroups: comp.lang.tcl
  431. Subject: Re: New security "feature" in Tk 3.3
  432. Date: 17 Sep 93 01:02:08
  433. Organization: The University of Texas at Austin
  434. Distribution: comp
  435. NNTP-Posting-Host: dino.ph.utexas.edu
  436. In-reply-to: ingwa@isy.liu.se's message of 14 Sep 93 08:55:31 GMT
  437. Status: RO
  438.  
  439. ingwa@isy.liu.se (Inge Wallin) writes:
  440.  
  441.    mjl@dino.ph.utexas.edu (Maurice J. LeBrun) writes:
  442.  
  443.    >In a previous article, I wrote:
  444.  
  445.    >   OK, my first cut at getting up under Tk 3.3b3 result in no major
  446.    >   problems save one: unauthorized attempts to connect.  This is due
  447.    >   to the new security check.  Turns out if ANY hosts are enabled by
  448.    >   the older xhost mechanism, the Tk send command aborts.
  449.    [deleted]
  450.    >   Hopefully I am doing something wrong.  Any suggestions?
  451.  
  452.    Actually, I am very happy that things are as you described.  I have
  453.    written a few programs using tcl/tk, and the send feature was the
  454.    thing that almost made me have second thoughts.  It is such a gigantic
  455.    security hole that I nearly skipped tk altogether.  However, in the
  456.    end, the ease of use of tcl/tk made me use it anyhow.
  457.  
  458. Well, the point was I couldn't get it to work, period!  Kind of useless
  459. in that case, eh?  Turns out that getting xauth-style security working
  460. involves a bit of voodoo sometimes, or so it seems.  
  461.  
  462. I agree about the security hole.  One of the first things I do in
  463. my initial Tcl script is the following:
  464.  
  465.     rename exec {}
  466.     rename open {}
  467.  
  468. I keep it right after any initial autoloads that I expect, but it
  469. still is a pain in the butt.
  470.  
  471.    What I would like to have is a way to enable a program to receive
  472.    sends.  If this was not used, the program would refuse to execute
  473.    sends from other applications.  One way to do this could be to use
  474.    "send enable" to enable the send command.
  475.  
  476. Right, me too.  It wouldn't be too hard to add such a capability.  I read
  477. that the favored approach is to have "secure" interpreters; one would
  478. communicate by TK send, but not execute -- it would pass what it receives
  479. (filtered?) to your internal interpreter.  Or something like that, it may
  480. be in the workshop proceedings.  Due out next release?
  481.  
  482.    Inge Wallin
  483.    ingwa@isy.liu.se
  484.    Dept. of EE
  485.    Linkoping University
  486.    Sweden
  487.  
  488. --
  489. Maurice LeBrun    mjl@dino.ph.utexas.edu
  490. Institute for Fusion Studies, University of Texas at Austin
  491.  
  492. Faire de la bonne cuisine demande un certain temps.  Si on vous fait
  493. attendre, c'est pour mieux vous servir, et vous plaire.
  494.                                 [menu of restaurant Antoine, New Orleans]
  495.  
  496. From mjl@dino.ph.utexas.edu Wed Sep 15 22:43 CDT 1993
  497. Received: by dino.ph.utexas.edu
  498.     (1.37.109.4/16.2) id AA05880; Wed, 15 Sep 93 22:41:29 -0500
  499. From: Maurice LeBrun <mjl@dino.ph.utexas.edu>
  500. Return-Path: <mjl@dino.ph.utexas.edu>
  501. Subject: Re: New security "feature" in Tk 3.3
  502. To: raines@SLAC.Stanford.EDU
  503. Date: Wed, 15 Sep 93 22:41:29 CDT
  504. Full-Name: Maurice LeBrun
  505. Cc: mjl@dino.ph.utexas.edu
  506. In-Reply-To: <9309160052.AA20499@unixhub.SLAC.Stanford.EDU>; from "Paul E. Raines" at Sep 15, 93 5:52 pm
  507. Mailer: Elm [revision: 70.85]
  508. Status: RO
  509.  
  510. > I hope you can help me.
  511. > I can't get Xauthority to work and the man pages explain
  512. > nothing. I am not trying to do anything with Tk yet, just get
  513. > it to work in general.
  514.  
  515. I sympathize.  I was there, and it is VERY frustrating.
  516.  
  517. > I did
  518. >     xauth add $DISPLAY . 12345678901234567890123456789012
  519. > All the machines at this site share the same home directory.
  520. > So I logged in remotely to anther machine and tried to run
  521. > an X app, but it was refused.
  522. > I restarted X, but still the same problem.
  523. > I restarted with
  524. >     startx -auth ~/.Xauthority
  525. > but X refused to run complaining
  526. >     /a/juno/u1/ra/raines/.Xauthority: ^DO@l^A0^RMIT-MAGIC-COOKIE-1^P^R4Vx^R4Vx^R4Vx^R:  not found.
  527. > What am I doing wrong?
  528.  
  529. Sounds like it should work.  I did, however, leave out one part of my
  530. tale.  I started out creating the ~/.Xauthority entry for my machine much 
  531. like you did.  I ended up rebooting my machine twice in all, and at some
  532. point it "noticed" I wanted to use ~/.Xauthority and started creating
  533. entries automatically upon login.  After the *next* time I rebooted (just
  534. to be sure the X server was reset; I had no idea how to do it otherwise
  535. using HP VUE), the access control worked!
  536.  
  537. The new entries it started creating look like the following:
  538.  
  539. dino.ph.utexas.edu:0  MIT-MAGIC-COOKIE-1  382f5...
  540. dino/unix:0  MIT-MAGIC-COOKIE-1  382f5...
  541. dino/unix:0  MIT-MAGIC-COOKIE-1  382f5...
  542.  
  543. The only entry I added was the first, but all three always share the same
  544. hex key.  Dunno why it added it twice.  And I've checked; every time I log
  545. in now I get a new hex key.  (Is this starting to resemble black magic
  546. yet?)
  547.  
  548. Maybe this can help, maybe not.  Maybe you need to chant and juggle some
  549. rubber chickens in front of the console :-).  It's stuff like this that
  550. makes me wonder if I really understand computers after all..
  551.  
  552. --
  553. Maurice LeBrun    mjl@dino.ph.utexas.edu
  554. Institute for Fusion Studies, University of Texas at Austin
  555.  
  556. Faire de la bonne cuisine demande un certain temps.  Si on vous fait
  557. attendre, c'est pour mieux vous servir, et vous plaire.
  558.                                 [menu of restaurant Antoine, New Orleans]
  559.  
  560. From doug@happy.vf.ge.com Mon Nov 15 00:41:17 1993
  561. Newsgroups: comp.lang.tcl,comp.windows.x
  562. From: doug@happy.vf.ge.com (Doug Hughes)
  563. Subject: Re: FINAL xauth ( on X-Terminals
  564. Followup-To: comp.windows.x
  565. Nntp-Posting-Host: happy.vf.ge.com
  566. Reply-To: doug@happy.vf.ge.com
  567. Organization: GE Aerospace - VF
  568. Date: Fri, 12 Nov 1993 13:16:43 GMT
  569.  
  570. In article <1993Nov12.084044@zam067.zam.kfa-juelich.de>, zdv145@zam067.zam.kfa-juelich.de (Helmut Schumacher) writes:
  571. > Does anyone have/use X-Terminals with Xauthority?
  572. > How must XDM be configured?
  573. > Can xauth be used without using XDM?
  574. > Helmut Schumacher
  575. > hel.schumacher@kfa-juelich.de
  576.  
  577. Well, I don't think this is the right newsgroup (comp.lang.tcl) so I'm
  578. cross-posting to comp.windows.x with followup redirected there. Anyway,
  579. yes, we use xauth for our NCD xterminals. You have to do to things, you
  580. have to have your xauth keys in two different places. 
  581.  
  582. 1) /usr/lib/X11/xdm/xdm-keys
  583. where entries look like this
  584. -Ethernet-00:00:a7:11:c9:c7     0xb0b125abe7cd00
  585.  
  586. 2) and entry in the configuration file (this would be xterminal specific)
  587.  
  588. on our NCD's running 3.1 software the entry looks like this in the ncd's
  589. configuration file
  590. login-xdm-authentication-key = 0xb0b125abe7cd00
  591.  
  592. Hope this helps (notice, the two keys are identical. very important. :) )
  593.  
  594. -- 
  595. _____________________________________________________________
  596. Doug Hughes
  597. System/Net Admin - Martin Marietta Aerospace, Valley Forge, PA
  598. doug@happy.vf.ge.com    or    doug@land.vf.ge.com
  599.  
  600.